only use legitimate shift counts in bitmap shifting
authorJan Beulich <jbeulich@suse.com>
Wed, 23 Apr 2014 13:07:55 +0000 (15:07 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 23 Apr 2014 13:07:55 +0000 (15:07 +0200)
commitcc01bd72a1ce1170d15e2b6edd888781ffee8596
treef1ebd2dea573791a235405efe8572e87bcd2722f
parent815dc9f1dba5782dcef77d8a002a11f5b1e5cc37
only use legitimate shift counts in bitmap shifting

For rem being zero (where rem is the remainder of a division by
BITS_PER_LONG), shifts by "BITS_PER_LONG - rem" degenerate to undefined
constructs.

An alternative would be to remove these implicitly unused functions.

Coverity ID 1192174 (__bitmap_shift_right)
Coverity ID 1192175 (__bitmap_shift_left)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/common/bitmap.c